import { fromJS } from 'immutable'
import * as constants from './constants'

const defaultState = fromJS({
  title:'',
  content:''
})

const reducer = (state = defaultState, action) => {
  switch (action.type) {
    case constants.DETAIL_LIST:
      console.log(action)
      return state.merge({
        title:fromJS(action.title),
        content: fromJS(action.content)
      })
    default:
      return state;
  }
}

export default reducer;